<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="widget-header">
	<i class="icon-th-list"></i>
	<h3>사용자 목록</h3>
</div>
<form method="get" id="frmMemberSearch">
<table class="table table-striped table-bordered">
	<tbody>
		<tr>
			<td>권한</td>
			<td>
				<select id="userRoleCd" name="userRoleCd">
					<option value="">전체</option>
				<c:forEach items="${roleList}" var="item">
					<c:if test="${param.userRoleCd == item.code}">
						<option value="${item.code}" selected="selected">${item.code_name}</option>
					</c:if>
					<c:if test="${param.userRoleCd != item.code}">
						<option value="${item.code}">${item.code_name}</option>
					</c:if>
				</c:forEach>
				</select>
			</td>
			<td>상태</td>
			<td>
				<select id="userStateCd" name="userStateCd">
					<option value="">전체</option>
				<c:forEach items="${stateList}" var="item">
					<c:if test="${param.userStateCd == item.code}">
						<option value="${item.code}" selected="selected">${item.code_name}</option>
					</c:if>
					<c:if test="${param.userStateCd != item.code}">
						<option value="${item.code}">${item.code_name}</option>
					</c:if>
				</c:forEach>
				</select>
			</td>
		</tr>
		<tr>
			<td>사용자</td>
			<td colspan="3">
				<input type="text" id="userNameText" name="userNameText" value="${param.userNameText}"/>
			</td>
		</tr>
		<tr>
			<td colspan="4" class="txt-right">
				<button type="submit" id=btnMemberSearch><i class="icon-search icon-txt"></i>조회</button>
			</td>
		</tr>
	</tbody>
</table>
</form>
<div class="btn-box txt-right">
	<button type="button" class="btn btn-info userEditForm"><i class="icon-pencil icon-txt"></i>등록</button>
</div>
<table id="table-members" class="table table-striped table-bordered">
	<thead>
		<tr>
			<th scope="row" >NO</th>
			<th scope="row" class="order" filed="user_name"><span>사용자명</span></th>
			<th scope="row" class="order" filed="user_id"><span>사용자 ID</span></th>
			<th scope="row" class="order" filed="user_role"><span>권한</span></th>
			<th scope="row" class="order" filed="user_state"><span>상태</span></th>
			<th scope="row" class="order" filed="created"><span>등록일</span></th>
			<th scope="row" class="order" filed="last_modified"><span>최근 수정일</span></th>
		</tr>
	</thead>
	<tbody binText="등록된 계정이 없습니다.">
		<c:choose>
			<c:when test="${!empty pagingList}">
				<c:forEach items="${pagingList}" var="item" varStatus="loop">
		            <tr>
		                <td class="textC"><span>${loop.count}</span></td>
		                <td><a class="userEditForm" userId="${item.user_id}">${item.user_name}</a></td>
		                <td>${item.user_id}</td>
		                <td class="groupName">${item.user_role_txt}</td>
		                <td class="groupName">${item.user_state_txt}</td>
		                <td class="textC"><fmt:formatDate value="${item.created}" pattern="yyyy-MM-dd"/></td>
		                <td class="textC"><fmt:formatDate value="${item.last_modified}" pattern="yyyy-MM-dd"/></td>
		            </tr>
		        </c:forEach>
			</c:when>
			<c:otherwise>
				<tr>
					<td scope="col" colspan="7" class="bin">등록된 계정이 없습니다.</td>
				</tr>
			</c:otherwise>
		</c:choose>
	</tbody>
</table>
<c:import url="../layout/paginate.jsp"></c:import>

<script type="text/javascript" src="<c:url value='/js/content/pageList.js'/>"></script>
<script type="text/javascript" src="<c:url value='/js/content/member/form.js'/>"></script>

